dnl Copyright (c) 2009-2010, Sean A.O. Harney <sharney3@gmail.com>
dnl Process this file with autoconf to produce a configure script.

define([svnversion], esyscmd([sh -c "svnversion|tr -d '\n'"]))
AC_INIT([omf], [0.1.svnversion])
AC_CONFIG_SRCDIR([src/main.c])

dnl foreign is least strict
AM_INIT_AUTOMAKE([foreign])

# Checks for programs.
AC_PROG_CC
AC_PROG_YACC
AM_PROG_LEX
#AM_PROG_LEX recommended over AC_PROG_LEX


# Checks for libraries.
# FIXME: Replace `main' with a function in `-lm':
#AC_CHECK_LIB([m], [main])
AC_CHECK_LIB([m], [cos])
AC_CHECK_LIB([crypt], [crypt])
#AC_CHECK_LIB([ssl], [SSL_accept])
AC_CHECK_LIB([ffi], [ffi_call])
AC_CHECK_LIB([zip], [zip_open])


# Checks for header files.
AC_FUNC_ALLOCA
AC_CHECK_HEADERS([fcntl.h inttypes.h libintl.h malloc.h stddef.h zip.h])
AC_HEADER_STDBOOL

# Checks for typedefs, structures, and compiler characteristics.
AC_TYPE_UINT8_T

# Checks for library functions.
AC_CHECK_FUNCS([strsignal dup2 strtol setpgid getpgid zip_open])

AC_CONFIG_FILES([Makefile src/Makefile test-omf-scripts/Makefile docs/Makefile man/Makefile])
AC_OUTPUT
